//
//  ZCRegistProticoyView.m
//  ZCJZ
//
//  Created by sujeking on 2019/5/24.
//  Copyright © 2019 jeking. All rights reserved.
//

#import "ZCRegistProticoyView.h"
#import "TBCityIconFont.h"
#import <BlocksKit+UIKit.h>
@interface ZCRegistProticoyView()

@property (weak, nonatomic) IBOutlet UIButton *check_btn;

@end


@implementation ZCRegistProticoyView

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupSubViews];
}

- (void)setupSubViews {
    UIImage *simg = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e648", 25, [generalToolBox getColorWithHexadecimalColorStr:@"0xC20114"])];
    UIImage *nimg = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e647", 25, [generalToolBox getColorWithHexadecimalColorStr:@"0xC20114"])];
    simg = [simg imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nimg = [nimg imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self.check_btn setImage:simg forState:UIControlStateSelected];
    [self.check_btn setImage:nimg forState:UIControlStateNormal];
    
    [self.check_btn bk_addEventHandler:^(id sender) {
        self.check_btn.selected = !self.check_btn.selected;
        
        if (self.checkBtnClickCallback) {
            self.checkBtnClickCallback(self.check_btn.selected);
        }
    } forControlEvents:UIControlEventTouchUpInside];
}

- (IBAction)fileBtnClickAction:(UIButton *)sender {
    if (self.fileBtnClickCallback) {
        self.fileBtnClickCallback(sender.tag - 20);
    }
}


@end
